/*
 *   Copyright (C) Key Bridge Global LLC and/or its affiliates.
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.keybridgeglobal.wsif.enumerated;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 * <p>Java class for enumSignatureAlgorithm.
 * <p/>
 * <p>The following schema fragment specifies the expected content contained
 * within this class. <p>
 * <pre>
 * &lt;simpleType name="enumSignatureAlgorithm">
 *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     &lt;enumeration value="NONEwithRSA"/>
 *     &lt;enumeration value="MD2withRSA"/>
 *     &lt;enumeration value="MD5withRSA"/>
 *     &lt;enumeration value="SHA1withRSA"/>
 *     &lt;enumeration value="SHA256withRSA"/>
 *     &lt;enumeration value="SHA384withRSA"/>
 *     &lt;enumeration value="SHA512withRSA"/>
 *     &lt;enumeration value="NONEwithDSA"/>
 *     &lt;enumeration value="SHA1withDSA"/>
 *     &lt;enumeration value="NONEwithECDSA"/>
 *     &lt;enumeration value="SHA1withECDSA"/>
 *     &lt;enumeration value="SHA256withECDSA"/>
 *     &lt;enumeration value="SHA384withECDSA"/>
 *     &lt;enumeration value="SHA512withECDSA"/>
 *   &lt;/restriction>
 * &lt;/simpleType>
 * </pre>
 * <p/>
 */
@XmlType(name = "enumSignatureAlgorithm")
@XmlEnum
public enum EnumSignatureAlgorithm {

  @XmlEnumValue("NONEwithRSA")
  NON_EWITH_RSA("NONEwithRSA"),
  @XmlEnumValue("MD2withRSA")
  MD_2_WITH_RSA("MD2withRSA"),
  @XmlEnumValue("MD5withRSA")
  MD_5_WITH_RSA("MD5withRSA"),
  @XmlEnumValue("SHA1withRSA")
  SHA_1_WITH_RSA("SHA1withRSA"),
  @XmlEnumValue("SHA256withRSA")
  SHA_256_WITH_RSA("SHA256withRSA"),
  @XmlEnumValue("SHA384withRSA")
  SHA_384_WITH_RSA("SHA384withRSA"),
  @XmlEnumValue("SHA512withRSA")
  SHA_512_WITH_RSA("SHA512withRSA"),
  @XmlEnumValue("NONEwithDSA")
  NON_EWITH_DSA("NONEwithDSA"),
  @XmlEnumValue("SHA1withDSA")
  SHA_1_WITH_DSA("SHA1withDSA"),
  @XmlEnumValue("NONEwithECDSA")
  NON_EWITH_ECDSA("NONEwithECDSA"),
  @XmlEnumValue("SHA1withECDSA")
  SHA_1_WITH_ECDSA("SHA1withECDSA"),
  @XmlEnumValue("SHA256withECDSA")
  SHA_256_WITH_ECDSA("SHA256withECDSA"),
  @XmlEnumValue("SHA384withECDSA")
  SHA_384_WITH_ECDSA("SHA384withECDSA"),
  @XmlEnumValue("SHA512withECDSA")
  SHA_512_WITH_ECDSA("SHA512withECDSA");
  private final String value;

  EnumSignatureAlgorithm(String v) {
    value = v;
  }

  public String value() {
    return value;
  }

  public static EnumSignatureAlgorithm fromValue(String v) {
    for (EnumSignatureAlgorithm c : EnumSignatureAlgorithm.values()) {
      if (c.value.equals(v)) {
        return c;
      }
    }
    throw new IllegalArgumentException(v);
  }
}
